package cn.doitedu.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @create: 2021-11-16 20:23
 * @author: 静如海的男人
 * @program: eagle-markting
 **/

public class MatchUtils {
    public static int matchCount(String sequenceStr, String regex) {
        Pattern compile = Pattern.compile(regex);
        Matcher matcher = compile.matcher(sequenceStr);
        int count = 0;
        while (matcher.find()) {
            count++;
        }

        return count;
    }
}
